package com.huang.app.antstore.fragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.alibaba.android.arouter.launcher.ARouter;
import com.huang.app.antstore.R;
import com.huang.app.antstore.databinding.FragmentTabShopBinding;

/**
 * Created by huangxiaoyu on 2017-6-21.
 */

public class FragmentTabShop extends Fragment {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        FragmentTabShopBinding viewBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_tab_shop, container, false);
        viewBinding.btnAction.setText("shop");
        viewBinding.btnAction.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ARouter.getInstance().build("/tabshop/mian").navigation();
            }
        });
        return viewBinding.getRoot();
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    public static Fragment newInstance() {
        Fragment fragment = new FragmentTabShop();
        return fragment;
    }

    public static Fragment newInstance(Bundle bundle) {
        Fragment fragment = new FragmentTabShop();
        if (bundle != null) {
            newInstance().setArguments(bundle);
        }
        return fragment;
    }
}
